//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2021 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto/tree/main/CodeGenerator. DO NOT EDIT.

import Foundation
import SotoCore

extension IVS {
    // MARK: Enums

    public enum ChannelLatencyMode: String, CustomStringConvertible, Codable {
        case low = "LOW"
        case normal = "NORMAL"
        public var description: String { return self.rawValue }
    }

    public enum ChannelType: String, CustomStringConvertible, Codable {
        case basic = "BASIC"
        case standard = "STANDARD"
        public var description: String { return self.rawValue }
    }

    public enum StreamHealth: String, CustomStringConvertible, Codable {
        case healthy = "HEALTHY"
        case starving = "STARVING"
        case unknown = "UNKNOWN"
        public var description: String { return self.rawValue }
    }

    public enum StreamState: String, CustomStringConvertible, Codable {
        case live = "LIVE"
        case offline = "OFFLINE"
        public var description: String { return self.rawValue }
    }

    // MARK: Shapes

    public struct BatchError: AWSDecodableShape {
        /// Channel ARN.
        public let arn: String?
        /// Error code.
        public let code: String?
        /// Error message, determined by the application.
        public let message: String?

        public init(arn: String? = nil, code: String? = nil, message: String? = nil) {
            self.arn = arn
            self.code = code
            self.message = message
        }

        private enum CodingKeys: String, CodingKey {
            case arn
            case code
            case message
        }
    }

    public struct BatchGetChannelRequest: AWSEncodableShape {
        /// Array of ARNs, one per channel.
        public let arns: [String]

        public init(arns: [String]) {
            self.arns = arns
        }

        public func validate(name: String) throws {
            try self.arns.forEach {
                try validate($0, name: "arns[]", parent: name, max: 128)
                try validate($0, name: "arns[]", parent: name, min: 1)
                try validate($0, name: "arns[]", parent: name, pattern: "^arn:aws:[is]vs:[a-z0-9-]+:[0-9]+:channel/[a-zA-Z0-9-]+$")
            }
            try self.validate(self.arns, name: "arns", parent: name, max: 50)
            try self.validate(self.arns, name: "arns", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case arns
        }
    }

    public struct BatchGetChannelResponse: AWSDecodableShape {
        public let channels: [Channel]?
        /// Each error object is related to a specific ARN in the request.
        public let errors: [BatchError]?

        public init(channels: [Channel]? = nil, errors: [BatchError]? = nil) {
            self.channels = channels
            self.errors = errors
        }

        private enum CodingKeys: String, CodingKey {
            case channels
            case errors
        }
    }

    public struct BatchGetStreamKeyRequest: AWSEncodableShape {
        /// Array of ARNs, one per channel.
        public let arns: [String]

        public init(arns: [String]) {
            self.arns = arns
        }

        public func validate(name: String) throws {
            try self.arns.forEach {
                try validate($0, name: "arns[]", parent: name, max: 128)
                try validate($0, name: "arns[]", parent: name, min: 1)
                try validate($0, name: "arns[]", parent: name, pattern: "^arn:aws:[is]vs:[a-z0-9-]+:[0-9]+:stream-key/[a-zA-Z0-9-]+$")
            }
            try self.validate(self.arns, name: "arns", parent: name, max: 50)
            try self.validate(self.arns, name: "arns", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case arns
        }
    }

    public struct BatchGetStreamKeyResponse: AWSDecodableShape {
        public let errors: [BatchError]?
        public let streamKeys: [StreamKey]?

        public init(errors: [BatchError]? = nil, streamKeys: [StreamKey]? = nil) {
            self.errors = errors
            self.streamKeys = streamKeys
        }

        private enum CodingKeys: String, CodingKey {
            case errors
            case streamKeys
        }
    }

    public struct Channel: AWSDecodableShape {
        /// Channel ARN.
        public let arn: String?
        /// Whether the channel is authorized.
        public let authorized: Bool?
        /// Channel ingest endpoint, part of the definition of an ingest server, used when you set up streaming software.
        public let ingestEndpoint: String?
        /// Channel latency mode. Default: LOW.
        public let latencyMode: ChannelLatencyMode?
        /// Channel name.
        public let name: String?
        /// Channel playback URL.
        public let playbackUrl: String?
        /// Array of 1-50 maps, each of the form string:string (key:value).
        public let tags: [String: String]?
        /// Channel type, which determines the allowable resolution and bitrate. If you exceed the allowable resolution or bitrate, the stream probably will disconnect immediately. Valid values:    STANDARD: Multiple qualities are generated from the original input, to automatically give viewers the best experience for their devices and network conditions. Vertical resolution can be up to 1080 and bitrate can be up to 8.5 Mbps.    BASIC: Amazon IVS delivers the original input to viewers. The viewer’s video-quality choice is limited to the original input. Vertical resolution can be up to 480 and bitrate can be up to 1.5 Mbps.   Default: STANDARD.
        public let type: ChannelType?

        public init(arn: String? = nil, authorized: Bool? = nil, ingestEndpoint: String? = nil, latencyMode: ChannelLatencyMode? = nil, name: String? = nil, playbackUrl: String? = nil, tags: [String: String]? = nil, type: ChannelType? = nil) {
            self.arn = arn
            self.authorized = authorized
            self.ingestEndpoint = ingestEndpoint
            self.latencyMode = latencyMode
            self.name = name
            self.playbackUrl = playbackUrl
            self.tags = tags
            self.type = type
        }

        private enum CodingKeys: String, CodingKey {
            case arn
            case authorized
            case ingestEndpoint
            case latencyMode
            case name
            case playbackUrl
            case tags
            case type
        }
    }

    public struct ChannelSummary: AWSDecodableShape {
        /// Channel ARN.
        public let arn: String?
        /// Whether the channel is authorized.
        public let authorized: Bool?
        /// Channel latency mode. Default: LOW.
        public let latencyMode: ChannelLatencyMode?
        /// Channel name.
        public let name: String?
        /// Array of 1-50 maps, each of the form string:string (key:value).
        public let tags: [String: String]?

        public init(arn: String? = nil, authorized: Bool? = nil, latencyMode: ChannelLatencyMode? = nil, name: String? = nil, tags: [String: String]? = nil) {
            self.arn = arn
            self.authorized = authorized
            self.latencyMode = latencyMode
            self.name = name
            self.tags = tags
        }

        private enum CodingKeys: String, CodingKey {
            case arn
            case authorized
            case latencyMode
            case name
            case tags
        }
    }

    public struct CreateChannelRequest: AWSEncodableShape {
        /// Whether the channel is authorized. Default: false.
        public let authorized: Bool?
        /// Channel latency mode. Default: LOW.
        public let latencyMode: ChannelLatencyMode?
        /// Channel name.
        public let name: String?
        /// See Channel$tags.
        public let tags: [String: String]?
        /// Channel type, which determines the allowable resolution and bitrate. If you exceed the allowable resolution or bitrate, the stream probably will disconnect immediately. Valid values:    STANDARD: Multiple qualities are generated from the original input, to automatically give viewers the best experience for their devices and network conditions. Vertical resolution can be up to 1080 and bitrate can be up to 8.5 Mbps.    BASIC: Amazon IVS delivers the original input to viewers. The viewer’s video-quality choice is limited to the original input. Vertical resolution can be up to 480 and bitrate can be up to 1.5 Mbps.   Default: STANDARD.
        public let type: ChannelType?

        public init(authorized: Bool? = nil, latencyMode: ChannelLatencyMode? = nil, name: String? = nil, tags: [String: String]? = nil, type: ChannelType? = nil) {
            self.authorized = authorized
            self.latencyMode = latencyMode
            self.name = name
            self.tags = tags
            self.type = type
        }

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, max: 128)
            try self.validate(self.name, name: "name", parent: name, min: 0)
            try self.validate(self.name, name: "name", parent: name, pattern: "^[a-zA-Z0-9-_]*$")
            try self.tags?.forEach {
                try validate($0.key, name: "tags.key", parent: name, max: 128)
                try validate($0.key, name: "tags.key", parent: name, min: 1)
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, max: 256)
            }
        }

        private enum CodingKeys: String, CodingKey {
            case authorized
            case latencyMode
            case name
            case tags
            case type
        }
    }

    public struct CreateChannelResponse: AWSDecodableShape {
        public let channel: Channel?
        public let streamKey: StreamKey?

        public init(channel: Channel? = nil, streamKey: StreamKey? = nil) {
            self.channel = channel
            self.streamKey = streamKey
        }

        private enum CodingKeys: String, CodingKey {
            case channel
            case streamKey
        }
    }

    public struct CreateStreamKeyRequest: AWSEncodableShape {
        /// ARN of the channel for which to create the stream key.
        public let channelArn: String
        /// See Channel$tags.
        public let tags: [String: String]?

        public init(channelArn: String, tags: [String: String]? = nil) {
            self.channelArn = channelArn
            self.tags = tags
        }

        public func validate(name: String) throws {
            try self.validate(self.channelArn, name: "channelArn", parent: name, max: 128)
            try self.validate(self.channelArn, name: "channelArn", parent: name, min: 1)
            try self.validate(self.channelArn, name: "channelArn", parent: name, pattern: "^arn:aws:[is]vs:[a-z0-9-]+:[0-9]+:channel/[a-zA-Z0-9-]+$")
            try self.tags?.forEach {
                try validate($0.key, name: "tags.key", parent: name, max: 128)
                try validate($0.key, name: "tags.key", parent: name, min: 1)
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, max: 256)
            }
        }

        private enum CodingKeys: String, CodingKey {
            case channelArn
            case tags
        }
    }

    public struct CreateStreamKeyResponse: AWSDecodableShape {
        /// Stream key used to authenticate an RTMPS stream for ingestion.
        public let streamKey: StreamKey?

        public init(streamKey: StreamKey? = nil) {
            self.streamKey = streamKey
        }

        private enum CodingKeys: String, CodingKey {
            case streamKey
        }
    }

    public struct DeleteChannelRequest: AWSEncodableShape {
        /// ARN of the channel to be deleted.
        public let arn: String

        public init(arn: String) {
            self.arn = arn
        }

        public func validate(name: String) throws {
            try self.validate(self.arn, name: "arn", parent: name, max: 128)
            try self.validate(self.arn, name: "arn", parent: name, min: 1)
            try self.validate(self.arn, name: "arn", parent: name, pattern: "^arn:aws:[is]vs:[a-z0-9-]+:[0-9]+:channel/[a-zA-Z0-9-]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case arn
        }
    }

    public struct DeletePlaybackKeyPairRequest: AWSEncodableShape {
        /// ARN of the key pair to be deleted.
        public let arn: String

        public init(arn: String) {
            self.arn = arn
        }

        public func validate(name: String) throws {
            try self.validate(self.arn, name: "arn", parent: name, max: 128)
            try self.validate(self.arn, name: "arn", parent: name, min: 1)
            try self.validate(self.arn, name: "arn", parent: name, pattern: "^arn:aws:[is]vs:[a-z0-9-]+:[0-9]+:playback-key/[a-zA-Z0-9-]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case arn
        }
    }

    public struct DeletePlaybackKeyPairResponse: AWSDecodableShape {
        public init() {}
    }

    public struct DeleteStreamKeyRequest: AWSEncodableShape {
        /// ARN of the stream key to be deleted.
        public let arn: String

        public init(arn: String) {
            self.arn = arn
        }

        public func validate(name: String) throws {
            try self.validate(self.arn, name: "arn", parent: name, max: 128)
            try self.validate(self.arn, name: "arn", parent: name, min: 1)
            try self.validate(self.arn, name: "arn", parent: name, pattern: "^arn:aws:[is]vs:[a-z0-9-]+:[0-9]+:stream-key/[a-zA-Z0-9-]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case arn
        }
    }

    public struct GetChannelRequest: AWSEncodableShape {
        /// ARN of the channel for which the configuration is to be retrieved.
        public let arn: String

        public init(arn: String) {
            self.arn = arn
        }

        public func validate(name: String) throws {
            try self.validate(self.arn, name: "arn", parent: name, max: 128)
            try self.validate(self.arn, name: "arn", parent: name, min: 1)
            try self.validate(self.arn, name: "arn", parent: name, pattern: "^arn:aws:[is]vs:[a-z0-9-]+:[0-9]+:channel/[a-zA-Z0-9-]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case arn
        }
    }

    public struct GetChannelResponse: AWSDecodableShape {
        public let channel: Channel?

        public init(channel: Channel? = nil) {
            self.channel = channel
        }

        private enum CodingKeys: String, CodingKey {
            case channel
        }
    }

    public struct GetPlaybackKeyPairRequest: AWSEncodableShape {
        /// ARN of the key pair to be returned.
        public let arn: String

        public init(arn: String) {
            self.arn = arn
        }

        public func validate(name: String) throws {
            try self.validate(self.arn, name: "arn", parent: name, max: 128)
            try self.validate(self.arn, name: "arn", parent: name, min: 1)
            try self.validate(self.arn, name: "arn", parent: name, pattern: "^arn:aws:[is]vs:[a-z0-9-]+:[0-9]+:playback-key/[a-zA-Z0-9-]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case arn
        }
    }

    public struct GetPlaybackKeyPairResponse: AWSDecodableShape {
        public let keyPair: PlaybackKeyPair?

        public init(keyPair: PlaybackKeyPair? = nil) {
            self.keyPair = keyPair
        }

        private enum CodingKeys: String, CodingKey {
            case keyPair
        }
    }

    public struct GetStreamKeyRequest: AWSEncodableShape {
        /// ARN for the stream key to be retrieved.
        public let arn: String

        public init(arn: String) {
            self.arn = arn
        }

        public func validate(name: String) throws {
            try self.validate(self.arn, name: "arn", parent: name, max: 128)
            try self.validate(self.arn, name: "arn", parent: name, min: 1)
            try self.validate(self.arn, name: "arn", parent: name, pattern: "^arn:aws:[is]vs:[a-z0-9-]+:[0-9]+:stream-key/[a-zA-Z0-9-]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case arn
        }
    }

    public struct GetStreamKeyResponse: AWSDecodableShape {
        public let streamKey: StreamKey?

        public init(streamKey: StreamKey? = nil) {
            self.streamKey = streamKey
        }

        private enum CodingKeys: String, CodingKey {
            case streamKey
        }
    }

    public struct GetStreamRequest: AWSEncodableShape {
        /// Channel ARN for stream to be accessed.
        public let channelArn: String

        public init(channelArn: String) {
            self.channelArn = channelArn
        }

        public func validate(name: String) throws {
            try self.validate(self.channelArn, name: "channelArn", parent: name, max: 128)
            try self.validate(self.channelArn, name: "channelArn", parent: name, min: 1)
            try self.validate(self.channelArn, name: "channelArn", parent: name, pattern: "^arn:aws:[is]vs:[a-z0-9-]+:[0-9]+:channel/[a-zA-Z0-9-]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case channelArn
        }
    }

    public struct GetStreamResponse: AWSDecodableShape {
        public let stream: Stream?

        public init(stream: Stream? = nil) {
            self.stream = stream
        }

        private enum CodingKeys: String, CodingKey {
            case stream
        }
    }

    public struct ImportPlaybackKeyPairRequest: AWSEncodableShape {
        /// An arbitrary string (a nickname) assigned to a playback key pair that helps the customer identify that resource. The value does not need to be unique.
        public let name: String?
        /// The public portion of a customer-generated key pair.
        public let publicKeyMaterial: String
        /// Any tags provided with the request are added to the playback key pair tags.
        public let tags: [String: String]?

        public init(name: String? = nil, publicKeyMaterial: String, tags: [String: String]? = nil) {
            self.name = name
            self.publicKeyMaterial = publicKeyMaterial
            self.tags = tags
        }

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, max: 128)
            try self.validate(self.name, name: "name", parent: name, min: 0)
            try self.validate(self.name, name: "name", parent: name, pattern: "^[a-zA-Z0-9-_]*$")
            try self.tags?.forEach {
                try validate($0.key, name: "tags.key", parent: name, max: 128)
                try validate($0.key, name: "tags.key", parent: name, min: 1)
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, max: 256)
            }
        }

        private enum CodingKeys: String, CodingKey {
            case name
            case publicKeyMaterial
            case tags
        }
    }

    public struct ImportPlaybackKeyPairResponse: AWSDecodableShape {
        public let keyPair: PlaybackKeyPair?

        public init(keyPair: PlaybackKeyPair? = nil) {
            self.keyPair = keyPair
        }

        private enum CodingKeys: String, CodingKey {
            case keyPair
        }
    }

    public struct ListChannelsRequest: AWSEncodableShape {
        /// Filters the channel list to match the specified name.
        public let filterByName: String?
        /// Maximum number of channels to return.
        public let maxResults: Int?
        /// The first channel to retrieve. This is used for pagination; see the nextToken response field.
        public let nextToken: String?

        public init(filterByName: String? = nil, maxResults: Int? = nil, nextToken: String? = nil) {
            self.filterByName = filterByName
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.filterByName, name: "filterByName", parent: name, max: 128)
            try self.validate(self.filterByName, name: "filterByName", parent: name, min: 0)
            try self.validate(self.filterByName, name: "filterByName", parent: name, pattern: "^[a-zA-Z0-9-_]*$")
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 50)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 500)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 0)
        }

        private enum CodingKeys: String, CodingKey {
            case filterByName
            case maxResults
            case nextToken
        }
    }

    public struct ListChannelsResponse: AWSDecodableShape {
        /// List of the matching channels.
        public let channels: [ChannelSummary]
        /// If there are more channels than maxResults, use nextToken in the request to get the next set.
        public let nextToken: String?

        public init(channels: [ChannelSummary], nextToken: String? = nil) {
            self.channels = channels
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case channels
            case nextToken
        }
    }

    public struct ListPlaybackKeyPairsRequest: AWSEncodableShape {
        /// The first key pair to retrieve. This is used for pagination; see the nextToken response field.
        public let maxResults: Int?
        /// Maximum number of key pairs to return.
        public let nextToken: String?

        public init(maxResults: Int? = nil, nextToken: String? = nil) {
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 50)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 500)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 0)
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults
            case nextToken
        }
    }

    public struct ListPlaybackKeyPairsResponse: AWSDecodableShape {
        /// List of key pairs.
        public let keyPairs: [PlaybackKeyPairSummary]
        /// If there are more key pairs than maxResults, use nextToken in the request to get the next set.
        public let nextToken: String?

        public init(keyPairs: [PlaybackKeyPairSummary], nextToken: String? = nil) {
            self.keyPairs = keyPairs
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case keyPairs
            case nextToken
        }
    }

    public struct ListStreamKeysRequest: AWSEncodableShape {
        /// Channel ARN used to filter the list.
        public let channelArn: String
        /// Maximum number of streamKeys to return.
        public let maxResults: Int?
        /// The first stream key to retrieve. This is used for pagination; see the nextToken response field.
        public let nextToken: String?

        public init(channelArn: String, maxResults: Int? = nil, nextToken: String? = nil) {
            self.channelArn = channelArn
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.channelArn, name: "channelArn", parent: name, max: 128)
            try self.validate(self.channelArn, name: "channelArn", parent: name, min: 1)
            try self.validate(self.channelArn, name: "channelArn", parent: name, pattern: "^arn:aws:[is]vs:[a-z0-9-]+:[0-9]+:channel/[a-zA-Z0-9-]+$")
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 50)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 500)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 0)
        }

        private enum CodingKeys: String, CodingKey {
            case channelArn
            case maxResults
            case nextToken
        }
    }

    public struct ListStreamKeysResponse: AWSDecodableShape {
        /// If there are more stream keys than maxResults, use nextToken in the request to get the next set.
        public let nextToken: String?
        /// List of stream keys.
        public let streamKeys: [StreamKeySummary]

        public init(nextToken: String? = nil, streamKeys: [StreamKeySummary]) {
            self.nextToken = nextToken
            self.streamKeys = streamKeys
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken
            case streamKeys
        }
    }

    public struct ListStreamsRequest: AWSEncodableShape {
        /// Maximum number of streams to return.
        public let maxResults: Int?
        /// The first stream to retrieve. This is used for pagination; see the nextToken response field.
        public let nextToken: String?

        public init(maxResults: Int? = nil, nextToken: String? = nil) {
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 50)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 500)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 0)
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults
            case nextToken
        }
    }

    public struct ListStreamsResponse: AWSDecodableShape {
        /// If there are more streams than maxResults, use nextToken in the request to get the next set.
        public let nextToken: String?
        /// List of streams.
        public let streams: [StreamSummary]

        public init(nextToken: String? = nil, streams: [StreamSummary]) {
            self.nextToken = nextToken
            self.streams = streams
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken
            case streams
        }
    }

    public struct ListTagsForResourceRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "resourceArn", location: .uri(locationName: "resourceArn"))
        ]

        /// Maximum number of tags to return.
        public let maxResults: Int?
        /// The first tag to retrieve. This is used for pagination; see the nextToken response field.
        public let nextToken: String?
        /// The ARN of the resource to be retrieved.
        public let resourceArn: String

        public init(maxResults: Int? = nil, nextToken: String? = nil, resourceArn: String) {
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.resourceArn = resourceArn
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 50)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, max: 128)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, min: 1)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, pattern: "^arn:aws:[is]vs:[a-z0-9-]+:[0-9]+:[a-z-]/[a-zA-Z0-9-]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults
            case nextToken
        }
    }

    public struct ListTagsForResourceResponse: AWSDecodableShape {
        /// If there are more tags than maxResults, use nextToken in the request to get the next set.
        public let nextToken: String?
        public let tags: [String: String]

        public init(nextToken: String? = nil, tags: [String: String]) {
            self.nextToken = nextToken
            self.tags = tags
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken
            case tags
        }
    }

    public struct PlaybackKeyPair: AWSDecodableShape {
        /// Key-pair ARN.
        public let arn: String?
        /// Key-pair identifier.
        public let fingerprint: String?
        /// Key-pair name.
        public let name: String?
        /// Array of 1-50 maps, each of the form string:string (key:value).
        public let tags: [String: String]?

        public init(arn: String? = nil, fingerprint: String? = nil, name: String? = nil, tags: [String: String]? = nil) {
            self.arn = arn
            self.fingerprint = fingerprint
            self.name = name
            self.tags = tags
        }

        private enum CodingKeys: String, CodingKey {
            case arn
            case fingerprint
            case name
            case tags
        }
    }

    public struct PlaybackKeyPairSummary: AWSDecodableShape {
        /// Key-pair ARN.
        public let arn: String?
        /// Key-pair name.
        public let name: String?
        /// Array of 1-50 maps, each of the form string:string (key:value)
        public let tags: [String: String]?

        public init(arn: String? = nil, name: String? = nil, tags: [String: String]? = nil) {
            self.arn = arn
            self.name = name
            self.tags = tags
        }

        private enum CodingKeys: String, CodingKey {
            case arn
            case name
            case tags
        }
    }

    public struct PutMetadataRequest: AWSEncodableShape {
        /// ARN of the channel into which metadata is inserted. This channel must have an active stream.
        public let channelArn: String
        /// Metadata to insert into the stream. Maximum: 1 KB per request.
        public let metadata: String

        public init(channelArn: String, metadata: String) {
            self.channelArn = channelArn
            self.metadata = metadata
        }

        public func validate(name: String) throws {
            try self.validate(self.channelArn, name: "channelArn", parent: name, max: 128)
            try self.validate(self.channelArn, name: "channelArn", parent: name, min: 1)
            try self.validate(self.channelArn, name: "channelArn", parent: name, pattern: "^arn:aws:[is]vs:[a-z0-9-]+:[0-9]+:channel/[a-zA-Z0-9-]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case channelArn
            case metadata
        }
    }

    public struct StopStreamRequest: AWSEncodableShape {
        /// ARN of the channel for which the stream is to be stopped.
        public let channelArn: String

        public init(channelArn: String) {
            self.channelArn = channelArn
        }

        public func validate(name: String) throws {
            try self.validate(self.channelArn, name: "channelArn", parent: name, max: 128)
            try self.validate(self.channelArn, name: "channelArn", parent: name, min: 1)
            try self.validate(self.channelArn, name: "channelArn", parent: name, pattern: "^arn:aws:[is]vs:[a-z0-9-]+:[0-9]+:channel/[a-zA-Z0-9-]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case channelArn
        }
    }

    public struct StopStreamResponse: AWSDecodableShape {
        public init() {}
    }

    public struct Stream: AWSDecodableShape {
        /// Channel ARN for the stream.
        public let channelArn: String?
        /// The stream’s health.
        public let health: StreamHealth?
        /// URL of the video master manifest, required by the video player to play the HLS stream.
        public let playbackUrl: String?
        /// ISO-8601 formatted timestamp of the stream’s start.
        @OptionalCustomCoding<ISO8601DateCoder>
        public var startTime: Date?
        /// The stream’s state.
        public let state: StreamState?
        /// Number of current viewers of the stream.
        public let viewerCount: Int64?

        public init(channelArn: String? = nil, health: StreamHealth? = nil, playbackUrl: String? = nil, startTime: Date? = nil, state: StreamState? = nil, viewerCount: Int64? = nil) {
            self.channelArn = channelArn
            self.health = health
            self.playbackUrl = playbackUrl
            self.startTime = startTime
            self.state = state
            self.viewerCount = viewerCount
        }

        private enum CodingKeys: String, CodingKey {
            case channelArn
            case health
            case playbackUrl
            case startTime
            case state
            case viewerCount
        }
    }

    public struct StreamKey: AWSDecodableShape {
        /// Stream-key ARN.
        public let arn: String?
        /// Channel ARN for the stream.
        public let channelArn: String?
        /// Array of 1-50 maps, each of the form string:string (key:value).
        public let tags: [String: String]?
        /// Stream-key value.
        public let value: String?

        public init(arn: String? = nil, channelArn: String? = nil, tags: [String: String]? = nil, value: String? = nil) {
            self.arn = arn
            self.channelArn = channelArn
            self.tags = tags
            self.value = value
        }

        private enum CodingKeys: String, CodingKey {
            case arn
            case channelArn
            case tags
            case value
        }
    }

    public struct StreamKeySummary: AWSDecodableShape {
        /// Stream-key ARN.
        public let arn: String?
        /// Channel ARN for the stream.
        public let channelArn: String?
        /// Array of 1-50 maps, each of the form string:string (key:value).
        public let tags: [String: String]?

        public init(arn: String? = nil, channelArn: String? = nil, tags: [String: String]? = nil) {
            self.arn = arn
            self.channelArn = channelArn
            self.tags = tags
        }

        private enum CodingKeys: String, CodingKey {
            case arn
            case channelArn
            case tags
        }
    }

    public struct StreamSummary: AWSDecodableShape {
        /// Channel ARN for the stream.
        public let channelArn: String?
        /// The stream’s health.
        public let health: StreamHealth?
        /// ISO-8601 formatted timestamp of the stream’s start.
        @OptionalCustomCoding<ISO8601DateCoder>
        public var startTime: Date?
        /// The stream’s state.
        public let state: StreamState?
        /// Number of current viewers of the stream.
        public let viewerCount: Int64?

        public init(channelArn: String? = nil, health: StreamHealth? = nil, startTime: Date? = nil, state: StreamState? = nil, viewerCount: Int64? = nil) {
            self.channelArn = channelArn
            self.health = health
            self.startTime = startTime
            self.state = state
            self.viewerCount = viewerCount
        }

        private enum CodingKeys: String, CodingKey {
            case channelArn
            case health
            case startTime
            case state
            case viewerCount
        }
    }

    public struct TagResourceRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "resourceArn", location: .uri(locationName: "resourceArn"))
        ]

        /// ARN of the resource for which tags are to be added or updated.
        public let resourceArn: String
        /// Array of tags to be added or updated.
        public let tags: [String: String]

        public init(resourceArn: String, tags: [String: String]) {
            self.resourceArn = resourceArn
            self.tags = tags
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, max: 128)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, min: 1)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, pattern: "^arn:aws:[is]vs:[a-z0-9-]+:[0-9]+:[a-z-]/[a-zA-Z0-9-]+$")
            try self.tags.forEach {
                try validate($0.key, name: "tags.key", parent: name, max: 128)
                try validate($0.key, name: "tags.key", parent: name, min: 1)
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, max: 256)
            }
        }

        private enum CodingKeys: String, CodingKey {
            case tags
        }
    }

    public struct TagResourceResponse: AWSDecodableShape {
        public init() {}
    }

    public struct UntagResourceRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "resourceArn", location: .uri(locationName: "resourceArn")),
            AWSMemberEncoding(label: "tagKeys", location: .querystring(locationName: "tagKeys"))
        ]

        /// ARN of the resource for which tags are to be removed.
        public let resourceArn: String
        /// Array of tags to be removed.
        public let tagKeys: [String]

        public init(resourceArn: String, tagKeys: [String]) {
            self.resourceArn = resourceArn
            self.tagKeys = tagKeys
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, max: 128)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, min: 1)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, pattern: "^arn:aws:[is]vs:[a-z0-9-]+:[0-9]+:[a-z-]/[a-zA-Z0-9-]+$")
            try self.tagKeys.forEach {
                try validate($0, name: "tagKeys[]", parent: name, max: 128)
                try validate($0, name: "tagKeys[]", parent: name, min: 1)
            }
            try self.validate(self.tagKeys, name: "tagKeys", parent: name, max: 50)
            try self.validate(self.tagKeys, name: "tagKeys", parent: name, min: 0)
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct UntagResourceResponse: AWSDecodableShape {
        public init() {}
    }

    public struct UpdateChannelRequest: AWSEncodableShape {
        /// ARN of the channel to be updated.
        public let arn: String
        /// Whether the channel is authorized. Default: false.
        public let authorized: Bool?
        /// Channel latency mode. Default: LOW.
        public let latencyMode: ChannelLatencyMode?
        /// Channel name.
        public let name: String?
        /// Channel type, which determines the allowable resolution and bitrate. If you exceed the allowable resolution or bitrate, the stream probably will disconnect immediately. Valid values:    STANDARD: Multiple qualities are generated from the original input, to automatically give viewers the best experience for their devices and network conditions. Vertical resolution can be up to 1080 and bitrate can be up to 8.5 Mbps.    BASIC: Amazon IVS delivers the original input to viewers. The viewer’s video-quality choice is limited to the original input. Vertical resolution can be up to 480 and bitrate can be up to 1.5 Mbps.   Default: STANDARD.
        public let type: ChannelType?

        public init(arn: String, authorized: Bool? = nil, latencyMode: ChannelLatencyMode? = nil, name: String? = nil, type: ChannelType? = nil) {
            self.arn = arn
            self.authorized = authorized
            self.latencyMode = latencyMode
            self.name = name
            self.type = type
        }

        public func validate(name: String) throws {
            try self.validate(self.arn, name: "arn", parent: name, max: 128)
            try self.validate(self.arn, name: "arn", parent: name, min: 1)
            try self.validate(self.arn, name: "arn", parent: name, pattern: "^arn:aws:[is]vs:[a-z0-9-]+:[0-9]+:channel/[a-zA-Z0-9-]+$")
            try self.validate(self.name, name: "name", parent: name, max: 128)
            try self.validate(self.name, name: "name", parent: name, min: 0)
            try self.validate(self.name, name: "name", parent: name, pattern: "^[a-zA-Z0-9-_]*$")
        }

        private enum CodingKeys: String, CodingKey {
            case arn
            case authorized
            case latencyMode
            case name
            case type
        }
    }

    public struct UpdateChannelResponse: AWSDecodableShape {
        public let channel: Channel?

        public init(channel: Channel? = nil) {
            self.channel = channel
        }

        private enum CodingKeys: String, CodingKey {
            case channel
        }
    }
}
